//
//  PopupControl.swift
//  foundationDemo
//
//  Created by Zhao Mingzhi on 16/6/27.
//  Copyright © 2016年 HNA. All rights reserved.
//

import Foundation
import UIKit

class PopupController:UIViewController{
    
    @IBOutlet weak var DatePicker: UIDatePicker!
    @IBOutlet weak var DateButton: UIButton!
    @IBOutlet weak var Lable: UILabel!
    @IBOutlet weak var sure: UIButton!
    @IBAction func SelectDate(sender: AnyObject) {
        self.DatePicker.hidden = false
        self.sure.hidden = false

    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.DatePicker.hidden = true
        self.sure.hidden = true
    }
    @IBAction func isDate(sender: AnyObject) {
        var Date:NSDate = self.DatePicker.date
        let desc = Date.descriptionWithLocale(NSLocale.currentLocale())
        
        var dateFormatter:NSDateFormatter = NSDateFormatter()
        
        dateFormatter.dateFormat="YYYY-MM-dd HH:mm:ss"
        
        self.Lable.text = dateFormatter.stringFromDate(Date)
        self.DatePicker.hidden = true
        self.sure.hidden = true
    }
    @IBAction func DateSure(sender: AnyObject) {
        
    }
}